import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);
//真正的路由配置项

const router = new VueRouter({
  scrollBehavior:()=>({y:0}),
  //后面会动态添加addroutes
  routes:[
    {
        path:'/user',
        name:'user',
        component:()=>import(/* webpackChunkName: "userbase" */'@/layouts/UserBase'),
        redirect:'/user/login',
        hidden:true, 
        children:[
            {
                path:'/user/login',
                name:'login',
                component:()=>import(/* webpackChunkName:"userlogin"*/'@/views/user/Login')
            },
            {
                path:'/user/forgetPassword',
                name:'forgetPassword',
                component:()=>import(/* webpackChunkName:"userforget"*/'@/views/UserForgetPassword/UserForgetPassword')
            }
        ]
    },
    {
        path:'/404',
        component:()=>import(/* webpackChunkName:"fail"*/'@/views/exception/404')
    },
  
  ],
});


export default router
